import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.junit.Test;


/**
 * Created by zyl on 17-6-1.
 */
public class MyBCTest {
    public static void main (String[] args) {

        String expression, again;

        int result;

        try
        {
            Scanner in = new Scanner(System.in);

            do
            {
                MyBC evaluator = new MyBC();
                System.out.println ("Enter a valid infix expression: ");
                expression = in.nextLine();
                result = evaluator.exchangexpr (expression);
                System.out.println();
                System.out.println ("That expression equals " + result);
                System.out.print ("Evaluate another expression [Y/N]? ");
                again = in.nextLine();
                System.out.println();
            }
            while (again.equalsIgnoreCase("y"));
        }
        catch (Exception IOException)
        {
            System.out.println("Input exception reported");
        }
    }
}
